import request from '@/utils/request';

// 获取列表
export const getClueData = (data: any) => {
    // return request({ url: `tienchin/clue/list?pageNum=${data.pageNum}&pageSize=${data.pageSize}`, method: "get" });
    return request({ url: `tienchin/clue/list`, method: "get", params: data });
};

// 获取渠道列表
export const getChannelData = () => {
    return request({ url: `tienchin/clue/channels`, method: "get" });
};

// 获取渠道列表
export const getChannelDataByid = (id: any) => {
    return request({ url: `tienchin/clue/${id}`, method: "get" });
};

// 新增线索
export const addClue = (data: any) => {
    return request({ url: `tienchin/clue`, method: "post", data: data });
};

// 删除线索
export const delClue = (data: any) => {
    return request({ url: `tienchin/clue/${data}`, method: "delete" });
};

// 修改线索
export const editClueaxios = (data: any) => {
    return request({ url: `tienchin/clue`, method: "put", data: data });
};

// 获取部门列表
export const getDeptList = () => {
    return request({ url: `system/dept/list`, method: "get" });
};

// 获取部门下拉列表
export const getDeptListselect = () => {
    return request({ url: `system/dept/treeselect`, method: "get" });
};

// 根据id获取数据
export const getxsdata = (id: any) => {
    return request({ url: `tienchin/clue/summary/${id}`, method: "get" });
};

// 提交跟进
export const tjgj = (data: any) => {
    return request({ url: `tienchin/clue/follow`, method: "post", data: data });
};

// 无效线索
export const fswxxs = (data: any) => {
    return request({ url: `tienchin/clue/invalid`, method: "post", data: data });
};

// 转为商机
export const changesj = (data: any) => {
    return request({ url: `tienchin/clue/to_business/${data}`, method: "post" });
};